import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Home from '../views/Home.vue'

import Main from '../views/Main.vue'
import ShopCar from '../views/ShopCar.vue'
import My from '../views/My.vue'


Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/main',
        name: 'main',
        component: Main
      },
      {
        path: '/shopCar',
        name: 'Shopcar',
        component: ShopCar
      },
      {
        path: '/my',
        name: 'My',
        component: My
      }
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
